/*      */ package com.zimbra.cs.account;
/*      */ 
/*      */ import com.google.common.annotations.VisibleForTesting;
/*      */ import com.google.common.base.Objects;
/*      */ import com.google.common.base.Objects.ToStringHelper;
/*      */ import com.google.common.collect.Lists;
/*      */ import com.zimbra.common.account.Key.AccountBy;
/*      */ import com.zimbra.common.account.Key.AlwaysOnClusterBy;
/*      */ import com.zimbra.common.account.Key.CacheEntryBy;
/*      */ import com.zimbra.common.account.Key.CalendarResourceBy;
/*      */ import com.zimbra.common.account.Key.CosBy;
/*      */ import com.zimbra.common.account.Key.DataSourceBy;
/*      */ import com.zimbra.common.account.Key.DistributionListBy;
/*      */ import com.zimbra.common.account.Key.DomainBy;
/*      */ import com.zimbra.common.account.Key.IdentityBy;
/*      */ import com.zimbra.common.account.Key.ServerBy;
/*      */ import com.zimbra.common.account.Key.ShareLocatorBy;
/*      */ import com.zimbra.common.account.Key.SignatureBy;
/*      */ import com.zimbra.common.account.Key.UCServiceBy;
/*      */ import com.zimbra.common.account.Key.XMPPComponentBy;
/*      */ import com.zimbra.common.account.ZAttrProvisioning;
/*      */ import com.zimbra.common.account.ZAttrProvisioning.AutoProvAuthMech;
/*      */ import com.zimbra.common.account.ZAttrProvisioning.Product;
/*      */ import com.zimbra.common.localconfig.KnownKey;
/*      */ import com.zimbra.common.localconfig.LC;
/*      */ import com.zimbra.common.service.ServiceException;
/*      */ import com.zimbra.common.util.ExceptionToString;
/*      */ import com.zimbra.common.util.L10nUtil;
/*      */ import com.zimbra.common.util.Log;
/*      */ import com.zimbra.common.util.StringUtil;
/*      */ import com.zimbra.common.util.ZimbraLog;
/*      */ import com.zimbra.cs.account.accesscontrol.Right;
/*      */ import com.zimbra.cs.account.accesscontrol.RightCommand.AllEffectiveRights;
/*      */ import com.zimbra.cs.account.accesscontrol.RightCommand.EffectiveRights;
/*      */ import com.zimbra.cs.account.accesscontrol.RightCommand.Grants;
/*      */ import com.zimbra.cs.account.accesscontrol.RightModifier;
/*      */ import com.zimbra.cs.account.auth.AuthContext.Protocol;
/*      */ import com.zimbra.cs.account.gal.GalOp;
/*      */ import com.zimbra.cs.account.ldap.LdapProvisioning;
/*      */ import com.zimbra.cs.account.names.NameUtil;
/*      */ import com.zimbra.cs.account.names.NameUtil.EmailAddress;
/*      */ import com.zimbra.cs.extension.ExtensionUtil;
/*      */ import com.zimbra.cs.gal.GalSearchParams;
/*      */ import com.zimbra.cs.ldap.ZLdapFilterFactory.FilterId;
/*      */ import com.zimbra.cs.mime.MimeTypeInfo;
/*      */ import com.zimbra.cs.util.AccountUtil;
/*      */ import com.zimbra.cs.util.Zimbra;
/*      */ import com.zimbra.soap.admin.type.CacheEntryType;
/*      */ import com.zimbra.soap.admin.type.CmdRightsInfo;
/*      */ import com.zimbra.soap.admin.type.CountObjectsType;
/*      */ import com.zimbra.soap.admin.type.DataSourceType;
/*      */ import com.zimbra.soap.admin.type.DistributionListSelector;
/*      */ import com.zimbra.soap.admin.type.DomainSelector;
/*      */ import com.zimbra.soap.admin.type.DomainSelector.DomainBy;
/*      */ import com.zimbra.soap.admin.type.GranteeSelector.GranteeBy;
/*      */ import com.zimbra.soap.admin.type.ServerSelector;
/*      */ import com.zimbra.soap.admin.type.UCServiceSelector;
/*      */ import com.zimbra.soap.type.AccountBy;
/*      */ import com.zimbra.soap.type.AccountSelector;
/*      */ import com.zimbra.soap.type.AutoProvPrincipalBy;
/*      */ import com.zimbra.soap.type.GalSearchType;
/*      */ import com.zimbra.soap.type.NamedElement;
/*      */ import com.zimbra.soap.type.TargetBy;
/*      */ import java.lang.reflect.Constructor;
/*      */ import java.util.ArrayList;
/*      */ import java.util.Collection;
/*      */ import java.util.HashMap;
/*      */ import java.util.List;
/*      */ import java.util.Locale;
/*      */ import java.util.Map;
/*      */ import java.util.Set;
/*      */ import javax.mail.internet.InternetAddress;
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ public abstract class Provisioning
/*      */   extends ZAttrProvisioning
/*      */ {
/*      */   static final String TRUE = "TRUE";
/*      */   static final String FALSE = "FALSE";
/*      */   public static final String DEFAULT_COS_NAME = "default";
/*      */   public static final String DEFAULT_EXTERNAL_COS_NAME = "defaultExternal";
/*      */   public static final String SERVICE_MAILBOX = "mailbox";
/*      */   public static final String SERVICE_PROXY = "proxy";
/*      */   public static final String SERVICE_MEMCACHED = "memcached";
/*      */   public static final String CAL_MODE_EXCHANGE = "exchange";
/*      */   public static final String CAL_MODE_STANDARD = "standard";
/*      */   public static final String FP_PREFIX_KERBEROS5 = "kerberos5:";
/*      */   public static final String FP_PREFIX_AD = "ad:";
/*      */   public static final String FP_PREFIX_CERT = "cert %s:%s";
/*      */   public static final String ACCOUNT_STATUS_ACTIVE = "active";
/*      */   public static final String ACCOUNT_STATUS_MAINTENANCE = "maintenance";
/*      */   public static final String ACCOUNT_STATUS_LOCKED = "locked";
/*      */   public static final String ACCOUNT_STATUS_LOCKOUT = "lockout";
/*      */   public static final String ACCOUNT_STATUS_PENDING = "pending";
/*      */   public static final String ACCOUNT_STATUS_CLOSED = "closed";
/*      */   public static final String MAIL_STATUS_ENABLED = "enabled";
/*      */   public static final String MAIL_STATUS_DISABLED = "disabled";
/*      */   public static final String DOMAIN_STATUS_ACTIVE = "active";
/*      */   public static final String DOMAIN_STATUS_MAINTENANCE = "maintenance";
/*      */   public static final String DOMAIN_STATUS_LOCKED = "locked";
/*      */   public static final String DOMAIN_STATUS_CLOSED = "closed";
/*      */   public static final String DOMAIN_STATUS_SUSPENDED = "suspended";
/*      */   public static final String DOMAIN_STATUS_SHUTDOWN = "shutdown";
/*      */   public static final String MAIL_FORMAT_TEXT = "text";
/*      */   public static final String MAIL_FORMAT_HTML = "html";
/*      */   public static final String MAIL_FORWARDREPLY_FORMAT_SAME = "same";
/*      */   public static final String MAIL_REFER_MODE_ALWAYS = "always";
/*      */   public static final String MAIL_REFER_MODE_WRONGHOST = "wronghost";
/*      */   public static final String MAIL_REFER_MODE_REVERSE_PROXIED = "reverse-proxied";
/*      */   public static final String A_dc = "dc";
/*      */   public static final String A_dgIdentity = "dgIdentity";
/*      */   public static final String A_member = "member";
/*      */   public static final String LDAP_AM_NONE = "none";
/*      */   public static final String LDAP_AM_SIMPLE = "simple";
/*      */   public static final String LDAP_AM_KERBEROS5 = "kerberos5";
/*      */   public static final int MAX_ZIMBRA_ID_LEN = 127;
/*      */   private final List<ProvisioningValidator> validators;
/*      */   private static volatile Provisioning singleton;
/*      */   public static final int SD_ACCOUNT_FLAG = 1;
/*      */   public static final int SD_ALIAS_FLAG = 2;
/*      */   public static final int SD_DISTRIBUTION_LIST_FLAG = 4;
/*      */   public static final int SD_CALENDAR_RESOURCE_FLAG = 8;
/*      */   public static final int SD_DOMAIN_FLAG = 16;
/*      */   public static final int SD_COS_FLAG = 32;
/*      */   public static final int SD_SERVER_FLAG = 64;
/*      */   public static final int SD_UC_SERVICE_FLAG = 128;
/*      */   public static final int SD_DYNAMIC_GROUP_FLAG = 256;
/*      */   public static final int SO_NO_FIXUP_OBJECTCLASS = 512;
/*      */   public static final int SO_NO_FIXUP_RETURNATTRS = 1024;
/*      */   public static final int SO_NO_ACCOUNT_DEFAULTS = 512;
/*      */   public static final int SO_NO_ACCOUNT_SECONDARY_DEFAULTS = 1024;
/*      */   public static final String SERVICE_WEBCLIENT = "zimbra";
/*      */   public static final String SERVICE_ADMINCLIENT = "zimbraAdmin";
/*      */   public static final String SERVICE_ZIMLET = "zimlet";
/*      */   public static final String SERVICE_MAILCLIENT = "service";
/*      */   
/*      */   public static enum MailMode
/*      */   {
/*  200 */     http,  https,  mixed,  both,  redirect;
/*      */     
/*      */     private MailMode() {}
/*      */     
/*  204 */     public static MailMode fromString(String s) throws ServiceException { try { return valueOf(s);
/*      */       } catch (IllegalArgumentException e) {
/*  206 */         throw ServiceException.INVALID_REQUEST("unknown mail mode: " + s, e);
/*      */       }
/*      */     }
/*      */   }
/*      */   
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */   public Provisioning()
/*      */   {
/*  232 */     this.validators = new ArrayList();
/*      */   }
/*      */   
/*      */   public static enum CacheMode
/*      */   {
/*  237 */     DEFAULT, 
/*  238 */     ON, 
/*  239 */     OFF;
/*      */     
/*      */     private CacheMode() {} }
/*      */   
/*  243 */   public static Provisioning getInstance() { return getInstance(CacheMode.DEFAULT); }
/*      */   
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */   public static Provisioning getInstance(CacheMode cacheMode)
/*      */   {
/*  258 */     if (singleton == null) {
/*  259 */       synchronized (Provisioning.class) {
/*  260 */         if (singleton == null) {
/*  261 */           if (cacheMode == null) {
/*  262 */             cacheMode = CacheMode.DEFAULT;
/*      */           }
/*      */           
/*  265 */           String className = LC.zimbra_class_provisioning.value();
/*      */           
/*  267 */           if ((className != null) && (!className.equals(""))) {
/*  268 */             Class<?> klass = null;
/*      */             try {
/*      */               try {
/*  271 */                 klass = Class.forName(className);
/*      */               }
/*      */               catch (ClassNotFoundException cnfe) {
/*  274 */                 klass = ExtensionUtil.findClass(className);
/*      */               }
/*      */               
/*  277 */               if (cacheMode != CacheMode.DEFAULT) {
/*      */                 try {
/*  279 */                   singleton = (Provisioning)klass.getConstructor(new Class[] { CacheMode.class }).newInstance(new Object[] { cacheMode });
/*      */                 }
/*      */                 catch (NoSuchMethodException e) {
/*  282 */                   ZimbraLog.account.error("could not find constructor with CacheMode parameter '" + className + "'; defaulting to LdapProvisioning", e);
/*      */                 }
/*      */                 
/*      */               } else {
/*  286 */                 singleton = (Provisioning)klass.newInstance();
/*      */               }
/*      */             } catch (Exception e) {
/*  289 */               ZimbraLog.account.error("could not instantiate Provisioning interface of class '" + className + "'; defaulting to LdapProvisioning", e);
/*      */             }
/*      */           }
/*      */           
/*      */ 
/*  294 */           if (singleton == null) {
/*  295 */             singleton = new LdapProvisioning(cacheMode);
/*  296 */             ZimbraLog.account.error("defaulting to " + singleton.getClass().getCanonicalName());
/*      */           }
/*      */         }
/*      */       }
/*      */     }
/*  301 */     return singleton;
/*      */   }
/*      */   
/*      */   @VisibleForTesting
/*      */   public static synchronized void setInstance(Provisioning prov) {
/*  306 */     singleton = prov;
/*      */   }
/*      */   
/*      */   public boolean idIsUUID() {
/*  310 */     return true;
/*      */   }
/*      */   
/*      */   public boolean isOctopus() throws ServiceException {
/*  314 */     return getConfig().getProduct() != ZAttrProvisioning.Product.ZCS;
/*      */   }
/*      */   
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */   public void modifyAttrs(Entry e, Map<String, ? extends Object> attrs)
/*      */     throws ServiceException
/*      */   {
/*  332 */     modifyAttrs(e, attrs, false);
/*      */   }
/*      */   
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */   public abstract void modifyAttrs(Entry paramEntry, Map<String, ? extends Object> paramMap, boolean paramBoolean)
/*      */     throws ServiceException;
/*      */   
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */   public void modifyAttrs(Entry e, Map<String, ? extends Object> attrs, boolean checkImmutable, AuthToken authToken)
/*      */     throws ServiceException
/*      */   {
/*  356 */     modifyAttrs(e, attrs, checkImmutable);
/*      */   }
/*      */   
/*      */ 
/*      */   public abstract void modifyAttrs(Entry paramEntry, Map<String, ? extends Object> paramMap, boolean paramBoolean1, boolean paramBoolean2)
/*      */     throws ServiceException;
/*      */   
/*      */ 
/*      */   public void restoreAccountAttrs(Account acct, Map<String, ? extends Object> backupAttrs)
/*      */     throws ServiceException
/*      */   {
/*  367 */     throw ServiceException.UNSUPPORTED();
/*      */   }
/*      */   
/*      */ 
/*      */ 
/*      */ 
/*      */   public static Object sanitizedAttrValue(String name, Object realValue)
/*      */   {
/*  375 */     if ((name.equalsIgnoreCase("userPassword")) || (name.equalsIgnoreCase("zimbraDataSourcePassword")) || (name.equalsIgnoreCase("zimbraFreebusyExchangeAuthPassword")) || (name.equalsIgnoreCase("zimbraUCPassword")))
/*      */     {
/*      */ 
/*      */ 
/*  379 */       return "VALUE-BLOCKED";
/*      */     }
/*  381 */     return realValue;
/*      */   }
/*      */   
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */   public abstract void reload(Entry paramEntry)
/*      */     throws ServiceException;
/*      */   
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */   public void reload(Entry e, boolean fromMaster)
/*      */     throws ServiceException
/*      */   {
/*  400 */     reload(e);
/*      */   }
/*      */   
/*      */   public Domain getDomain(MailTarget mailTarget) throws ServiceException {
/*  404 */     if ((mailTarget instanceof Alias))
/*  405 */       return getDomain((Alias)mailTarget);
/*  406 */     if ((mailTarget instanceof Account))
/*  407 */       return getDomain((Account)mailTarget);
/*  408 */     if ((mailTarget instanceof DistributionList))
/*  409 */       return getDomain((DistributionList)mailTarget);
/*  410 */     if ((mailTarget instanceof DynamicGroup)) {
/*  411 */       return getDomain((DynamicGroup)mailTarget);
/*      */     }
/*  413 */     return null;
/*      */   }
/*      */   
/*      */ 
/*      */ 
/*      */   public Domain getDomain(Account acct)
/*      */     throws ServiceException
/*      */   {
/*  421 */     String dname = acct.getDomainName();
/*  422 */     boolean checkNegativeCache = acct instanceof GuestAccount;
/*  423 */     return dname == null ? null : getDomain(Key.DomainBy.name, dname, checkNegativeCache);
/*      */   }
/*      */   
/*      */ 
/*      */ 
/*      */   public Domain getDomain(Alias alias)
/*      */     throws ServiceException
/*      */   {
/*  431 */     String dname = alias.getDomainName();
/*  432 */     return dname == null ? null : getDomain(Key.DomainBy.name, dname, false);
/*      */   }
/*      */   
/*      */   public Domain getDomainByEmailAddr(String emailAddr) throws ServiceException {
/*  436 */     String domainName = NameUtil.EmailAddress.getDomainNameFromEmail(emailAddr);
/*  437 */     Domain domain = getInstance().get(Key.DomainBy.name, domainName);
/*  438 */     if (domain == null) {
/*  439 */       throw AccountServiceException.NO_SUCH_DOMAIN(domainName);
/*      */     }
/*  441 */     return domain;
/*      */   }
/*      */   
/*      */   public Domain getDefaultDomain() throws ServiceException {
/*  445 */     String dname = getConfig().getDefaultDomainName();
/*  446 */     return dname == null ? null : getDomain(Key.DomainBy.name, dname, true);
/*      */   }
/*      */   
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */   public Server getServer(Account acct)
/*      */     throws ServiceException
/*      */   {
/*  456 */     return acct.getServer();
/*      */   }
/*      */   
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */   public Cos getCOS(Account acct)
/*      */     throws ServiceException
/*      */   {
/*  466 */     Cos cos = (Cos)acct.getCachedData(EntryCacheDataKey.ACCOUNT_COS);
/*  467 */     if (cos == null) {
/*  468 */       String id = acct.getCOSId();
/*  469 */       if (id != null) {
/*  470 */         cos = get(Key.CosBy.id, id);
/*      */       }
/*  472 */       if (cos == null) {
/*  473 */         Domain domain = getDomain(acct);
/*  474 */         String domainCosId = domain != null ? domain.getDomainDefaultCOSId() : acct.isIsExternalVirtualAccount() ? domain.getDomainDefaultExternalUserCOSId() : null;
/*      */         
/*  476 */         if (domainCosId != null) {
/*  477 */           cos = get(Key.CosBy.id, domainCosId);
/*      */         }
/*      */       }
/*  480 */       if (cos == null) {
/*  481 */         cos = get(Key.CosBy.name, acct.isIsExternalVirtualAccount() ? "defaultExternal" : "default");
/*      */       }
/*      */       
/*  484 */       if (cos != null) {
/*  485 */         acct.setCachedData(EntryCacheDataKey.ACCOUNT_COS, cos);
/*      */       }
/*      */     }
/*  488 */     return cos;
/*      */   }
/*      */   
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */   public AlwaysOnCluster getAlwaysOnCluster(Server server)
/*      */     throws ServiceException
/*      */   {
/*  498 */     AlwaysOnCluster aoc = (AlwaysOnCluster)server.getCachedData(EntryCacheDataKey.SERVER_ALWAYSONCLUSTER);
/*  499 */     if (aoc == null) {
/*  500 */       String id = server.getAlwaysOnClusterId();
/*  501 */       if (id != null) {
/*  502 */         aoc = get(Key.AlwaysOnClusterBy.id, id);
/*      */       }
/*  504 */       if (aoc != null) {
/*  505 */         server.setCachedData(EntryCacheDataKey.SERVER_ALWAYSONCLUSTER, aoc);
/*      */       }
/*      */     }
/*  508 */     return aoc;
/*      */   }
/*      */   
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */   public String getEmailAddrByDomainAlias(String emailAddress)
/*      */     throws ServiceException
/*      */   {
/*  518 */     String addr = null;
/*      */     
/*  520 */     String[] parts = emailAddress.split("@");
/*  521 */     if (parts.length == 2) {
/*  522 */       Domain domain = getDomain(Key.DomainBy.name, parts[1], true);
/*  523 */       if ((domain != null) && 
/*  524 */         (!domain.isLocal())) {
/*  525 */         String targetDomainId = domain.getAttr("zimbraDomainAliasTargetId");
/*  526 */         if (targetDomainId != null) {
/*  527 */           domain = getDomainById(targetDomainId);
/*  528 */           if (domain != null) {
/*  529 */             addr = parts[0] + "@" + domain.getName();
/*      */           }
/*      */         }
/*      */       }
/*      */     }
/*      */     
/*      */ 
/*  536 */     return addr;
/*      */   }
/*      */   
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */   public static class GroupMemberEmailAddrs
/*      */   {
/*      */     private String groupAddr;
/*      */     
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */     private Collection<String> internalAddrs;
/*      */     
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */     private Collection<String> externalAddrs;
/*      */     
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */     public void setGroupAddr(String addr)
/*      */     {
/*  574 */       this.groupAddr = addr;
/*      */     }
/*      */     
/*      */     public void setInternalAddrs(Collection<String> addrs) {
/*  578 */       this.internalAddrs = addrs;
/*      */     }
/*      */     
/*      */     public void setExternalAddrs(Collection<String> addrs) {
/*  582 */       this.externalAddrs = addrs;
/*      */     }
/*      */     
/*      */ 
/*      */ 
/*      */ 
/*      */     public String groupAddr()
/*      */     {
/*  590 */       return this.groupAddr;
/*      */     }
/*      */     
/*      */ 
/*      */ 
/*      */ 
/*      */     public Collection<String> internalAddrs()
/*      */     {
/*  598 */       return this.internalAddrs;
/*      */     }
/*      */     
/*      */ 
/*      */ 
/*      */ 
/*      */     public Collection<String> externalAddrs()
/*      */     {
/*  606 */       return this.externalAddrs;
/*      */     }
/*      */   }
/*      */   
/*      */   public GroupMemberEmailAddrs getMemberAddrs(Group group) throws ServiceException {
/*  611 */     throw new UnsupportedOperationException();
/*      */   }
/*      */   
/*      */   public boolean inDistributionList(MailTarget mailTarget, String zimbraId) throws ServiceException
/*      */   {
/*  616 */     if ((mailTarget instanceof Account))
/*  617 */       return inDistributionList((Account)mailTarget, zimbraId);
/*  618 */     if ((mailTarget instanceof DistributionList)) {
/*  619 */       return inDistributionList((DistributionList)mailTarget, zimbraId);
/*      */     }
/*  621 */     return false;
/*      */   }
/*      */   
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */   public abstract boolean inDistributionList(Account paramAccount, String paramString)
/*      */     throws ServiceException;
/*      */   
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */   public boolean inDistributionList(DistributionList list, String zimbraId)
/*      */     throws ServiceException
/*      */   {
/*  640 */     throw ServiceException.UNSUPPORTED();
/*      */   }
/*      */   
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */   public abstract Set<String> getDistributionLists(Account paramAccount)
/*      */     throws ServiceException;
/*      */   
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */   public abstract Set<String> getDirectDistributionLists(Account paramAccount)
/*      */     throws ServiceException;
/*      */   
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */   public abstract List<DistributionList> getDistributionLists(Account paramAccount, boolean paramBoolean, Map<String, String> paramMap)
/*      */     throws ServiceException;
/*      */   
/*      */ 
/*      */ 
/*      */ 
/*      */   public abstract List<DistributionList> getDistributionLists(DistributionList paramDistributionList, boolean paramBoolean, Map<String, String> paramMap)
/*      */     throws ServiceException;
/*      */   
/*      */ 
/*      */ 
/*      */ 
/*      */   public static class MemberOf
/*      */   {
/*      */     private final String mId;
/*      */     
/*      */ 
/*      */ 
/*      */     private final boolean mIsAdminGroup;
/*      */     
/*      */ 
/*      */ 
/*      */     private final boolean mIsDynamicGroup;
/*      */     
/*      */ 
/*      */ 
/*      */ 
/*      */     public MemberOf(String id, boolean isAdminGroup, boolean isDynamicGroup)
/*      */     {
/*  690 */       this.mId = id;
/*  691 */       this.mIsAdminGroup = isAdminGroup;
/*  692 */       this.mIsDynamicGroup = isDynamicGroup;
/*      */     }
/*      */     
/*      */     public String getId() {
/*  696 */       return this.mId;
/*      */     }
/*      */     
/*      */     public boolean isAdminGroup() {
/*  700 */       return this.mIsAdminGroup;
/*      */     }
/*      */     
/*      */     public String toString()
/*      */     {
/*  705 */       return Objects.toStringHelper(this).add("mId", this.mId).add("mIsAdminGroup", this.mIsAdminGroup).add("mIsDynamicGroup", this.mIsDynamicGroup).toString();
/*      */     }
/*      */   }
/*      */   
/*      */ 
/*      */ 
/*      */ 
/*      */   public static class GroupMembershipAtTime
/*      */   {
/*      */     final Provisioning.GroupMembership membership;
/*      */     
/*      */ 
/*      */     final long correctAtTime;
/*      */     
/*      */ 
/*      */ 
/*      */     public GroupMembershipAtTime(Provisioning.GroupMembership members, long accurateAtTime)
/*      */     {
/*  723 */       this.membership = members;
/*  724 */       this.correctAtTime = accurateAtTime;
/*      */     }
/*      */     
/*  727 */     public Provisioning.GroupMembership getMembership() { return this.membership; }
/*      */     
/*      */     public long getCorrectAtTime() {
/*  730 */       return this.correctAtTime;
/*      */     }
/*      */   }
/*      */   
/*      */   public static class GroupMembership {
/*      */     List<Provisioning.MemberOf> mMemberOf;
/*      */     List<String> mGroupIds;
/*      */     
/*      */     public GroupMembership(List<Provisioning.MemberOf> memberOf, List<String> groupIds) {
/*  739 */       this.mMemberOf = memberOf;
/*  740 */       this.mGroupIds = groupIds;
/*      */     }
/*      */     
/*      */     public GroupMembership()
/*      */     {
/*  745 */       this(new ArrayList(), new ArrayList());
/*      */     }
/*      */     
/*      */     public void append(Provisioning.MemberOf memberOf, String groupId) {
/*  749 */       this.mMemberOf.add(memberOf);
/*  750 */       this.mGroupIds.add(groupId);
/*      */     }
/*      */     
/*      */     public void append(Provisioning.MemberOf memberOf) {
/*  754 */       this.mMemberOf.add(memberOf);
/*  755 */       this.mGroupIds.add(memberOf.getId());
/*      */     }
/*      */     
/*      */     public GroupMembership mergeFrom(GroupMembership other) {
/*  759 */       for (int i = 0; i < other.mMemberOf.size(); i++) {
/*  760 */         if (!this.mGroupIds.contains(other.mGroupIds.get(i))) {
/*  761 */           append((Provisioning.MemberOf)other.mMemberOf.get(i), (String)other.mGroupIds.get(i));
/*      */         }
/*      */       }
/*  764 */       return this;
/*      */     }
/*      */     
/*      */     public List<Provisioning.MemberOf> memberOf() {
/*  768 */       return this.mMemberOf;
/*      */     }
/*      */     
/*      */     public Provisioning.MemberOf getMemberOfForId(String grpId) {
/*  772 */       for (Provisioning.MemberOf memberOf : this.mMemberOf) {
/*  773 */         if (grpId.equals(memberOf.getId())) {
/*  774 */           return memberOf;
/*      */         }
/*      */       }
/*  777 */       return null;
/*      */     }
/*      */     
/*      */     public List<String> groupIds() {
/*  781 */       return this.mGroupIds;
/*      */     }
/*      */     
/*      */     public GroupMembership clone()
/*      */     {
/*  786 */       GroupMembership copy = new GroupMembership();
/*  787 */       for (int i = 0; i < this.mMemberOf.size(); i++) {
/*  788 */         copy.append((Provisioning.MemberOf)this.mMemberOf.get(i), (String)this.mGroupIds.get(i));
/*      */       }
/*  790 */       return copy;
/*      */     }
/*      */     
/*      */     public String toString()
/*      */     {
/*  795 */       return Objects.toStringHelper(this).add("mMemberOf", this.mMemberOf).add("mGroupIds", this.mGroupIds).toString();
/*      */     }
/*      */   }
/*      */   
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */   public GroupMembership getGroupMembership(MailTarget mailTarget, boolean adminGroupsOnly)
/*      */     throws ServiceException
/*      */   {
/*  812 */     if ((mailTarget instanceof Account))
/*  813 */       return getGroupMembership((Account)mailTarget, adminGroupsOnly);
/*  814 */     if ((mailTarget instanceof DistributionList)) {
/*  815 */       return getGroupMembership((DistributionList)mailTarget, adminGroupsOnly);
/*      */     }
/*  817 */     return new GroupMembership();
/*      */   }
/*      */   
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */   public GroupMembership getGroupMembership(Account acct, boolean adminGroupsOnly)
/*      */     throws ServiceException
/*      */   {
/*  830 */     throw ServiceException.UNSUPPORTED();
/*      */   }
/*      */   
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */   public GroupMembership getGroupMembership(DistributionList list, boolean adminGroupsOnly)
/*      */     throws ServiceException
/*      */   {
/*  844 */     throw ServiceException.UNSUPPORTED();
/*      */   }
/*      */   
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */   public GroupMembership getGroupMembershipWithRights(Account acct, Set<Right> rights, boolean adminGroupsOnly)
/*      */     throws ServiceException
/*      */   {
/*  857 */     throw ServiceException.UNSUPPORTED();
/*      */   }
/*      */   
/*      */ 
/*      */ 
/*      */   public Domain getDomain(DistributionList dl)
/*      */     throws ServiceException
/*      */   {
/*  865 */     String dname = dl.getDomainName();
/*  866 */     return dname == null ? null : get(Key.DomainBy.name, dname);
/*      */   }
/*      */   
/*      */ 
/*      */ 
/*      */   public Domain getDomain(DynamicGroup dynGroup)
/*      */     throws ServiceException
/*      */   {
/*  874 */     String dname = dynGroup.getDomainName();
/*  875 */     return dname == null ? null : get(Key.DomainBy.name, dname);
/*      */   }
/*      */   
/*      */   public abstract boolean healthCheck() throws ServiceException;
/*      */   
/*      */   public abstract Config getConfig() throws ServiceException;
/*      */   
/*      */   public Config getConfig(String attr) throws ServiceException {
/*  883 */     return getConfig();
/*      */   }
/*      */   
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */   public abstract GlobalGrant getGlobalGrant()
/*      */     throws ServiceException;
/*      */   
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */   public abstract List<MimeTypeInfo> getMimeTypes(String paramString)
/*      */     throws ServiceException;
/*      */   
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */   public abstract List<MimeTypeInfo> getAllMimeTypes()
/*      */     throws ServiceException;
/*      */   
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */   public abstract Account createAccount(String paramString1, String paramString2, Map<String, Object> paramMap)
/*      */     throws ServiceException;
/*      */   
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */   public abstract Account restoreAccount(String paramString1, String paramString2, Map<String, Object> paramMap1, Map<String, Object> paramMap2)
/*      */     throws ServiceException;
/*      */   
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */   public abstract void deleteAccount(String paramString)
/*      */     throws ServiceException;
/*      */   
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */   public abstract void renameAccount(String paramString1, String paramString2)
/*      */     throws ServiceException;
/*      */   
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */   public abstract Account get(Key.AccountBy paramAccountBy, String paramString)
/*      */     throws ServiceException;
/*      */   
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */   public Account get(AccountSelector acctSel)
/*      */     throws ServiceException
/*      */   {
/*  968 */     return get(acctSel.getBy().toKeyAccountBy(), acctSel.getKey());
/*      */   }
/*      */   
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */   public void autoProvAccountEager(EagerAutoProvisionScheduler scheduler)
/*      */     throws ServiceException
/*      */   {
/*  984 */     throw ServiceException.UNSUPPORTED();
/*      */   }
/*      */   
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */   public Account autoProvAccountLazy(Domain domain, String loginName, String loginPassword, ZAttrProvisioning.AutoProvAuthMech authMech)
/*      */     throws ServiceException
/*      */   {
/* 1007 */     throw ServiceException.UNSUPPORTED();
/*      */   }
/*      */   
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */   public Account autoProvAccountManual(Domain domain, AutoProvPrincipalBy by, String principal, String password)
/*      */     throws ServiceException
/*      */   {
/* 1022 */     throw ServiceException.UNSUPPORTED();
/*      */   }
/*      */   
/*      */   public void autoProvControl(String action) throws ServiceException {
/* 1026 */     throw ServiceException.UNSUPPORTED();
/*      */   }
/*      */   
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */   public void searchAutoProvDirectory(Domain domain, String filter, String name, String[] returnAttrs, int maxResults, DirectoryEntryVisitor visitor)
/*      */     throws ServiceException
/*      */   {
/* 1036 */     throw ServiceException.UNSUPPORTED();
/*      */   }
/*      */   
/*      */ 
/*      */ 
/* 1041 */   public Account getAccountByName(String name) throws ServiceException { return get(Key.AccountBy.name, name); }
/* 1042 */   public Account getAccountById(String id) throws ServiceException { return get(Key.AccountBy.id, id); }
/* 1043 */   public Account getAccountByAppAdminName(String name) throws ServiceException { return get(Key.AccountBy.appAdminName, name); }
/* 1044 */   public Account getAccountByForeignPrincipal(String name) throws ServiceException { return get(Key.AccountBy.foreignPrincipal, name); }
/* 1045 */   public Account getAccountByKrb5Principal(String name) throws ServiceException { return get(Key.AccountBy.krb5Principal, name); }
/*      */   
/*      */   public Account getAccountByForeignName(String foreignName, String application, Domain domain) throws ServiceException {
/* 1048 */     throw ServiceException.UNSUPPORTED();
/*      */   }
/*      */   
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */   public Account get(Key.AccountBy keyType, String key, boolean loadFromMaster)
/*      */     throws ServiceException
/*      */   {
/* 1064 */     return get(keyType, key);
/*      */   }
/*      */   
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */   public Account get(Key.AccountBy keyType, String key, AuthToken authToken)
/*      */     throws ServiceException
/*      */   {
/* 1077 */     return get(keyType, key);
/*      */   }
/*      */   
/*      */   public Account get(AccountSelector acctSel, AuthToken authToken) throws ServiceException
/*      */   {
/* 1082 */     return get(acctSel.getBy().toKeyAccountBy(), acctSel.getKey(), authToken);
/*      */   }
/*      */   
/*      */   public Account get(Key.AccountBy keyType, String key, boolean loadFromMaster, AuthToken authToken) throws ServiceException {
/* 1086 */     return get(keyType, key, loadFromMaster);
/*      */   }
/*      */   
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */   public Account getAccount(String key)
/*      */     throws ServiceException
/*      */   {
/* 1099 */     Account acct = null;
/*      */     
/* 1101 */     if (isUUID(key)) {
/* 1102 */       acct = get(Key.AccountBy.id, key);
/*      */     }
/*      */     else {
/* 1105 */       acct = get(Key.AccountBy.name, key);
/* 1106 */       if (acct == null) {
/* 1107 */         acct = get(Key.AccountBy.id, key);
/*      */       }
/*      */     }
/* 1110 */     return acct;
/*      */   }
/*      */   
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */   public abstract List<Account> getAllAdminAccounts()
/*      */     throws ServiceException;
/*      */   
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */   public abstract void setCOS(Account paramAccount, Cos paramCos)
/*      */     throws ServiceException;
/*      */   
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */   public abstract void modifyAccountStatus(Account paramAccount, String paramString)
/*      */     throws ServiceException;
/*      */   
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */   public abstract void authAccount(Account paramAccount, String paramString, AuthContext.Protocol paramProtocol)
/*      */     throws ServiceException;
/*      */   
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */   public abstract void authAccount(Account paramAccount, String paramString, AuthContext.Protocol paramProtocol, Map<String, Object> paramMap)
/*      */     throws ServiceException;
/*      */   
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */   public void accountAuthed(Account acct)
/*      */     throws ServiceException
/*      */   {}
/*      */   
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */   public void preAuthAccount(Account acct, String accountName, String accountBy, long timestamp, long expires, String preAuth, boolean admin, Map<String, Object> authCtxt)
/*      */     throws ServiceException
/*      */   {
/* 1191 */     if (admin) {
/* 1192 */       throw ServiceException.UNSUPPORTED();
/*      */     }
/* 1194 */     preAuthAccount(acct, accountName, accountBy, timestamp, expires, preAuth, authCtxt);
/*      */   }
/*      */   
/*      */ 
/*      */ 
/*      */   public abstract void preAuthAccount(Account paramAccount, String paramString1, String paramString2, long paramLong1, long paramLong2, String paramString3, Map<String, Object> paramMap)
/*      */     throws ServiceException;
/*      */   
/*      */ 
/* 1204 */   public void preAuthAccount(Domain domain, String accountName, String accountBy, long timestamp, long expires, String preAuth, Map<String, Object> authCtxt)
/* 1204 */     throws ServiceException { throw ServiceException.UNSUPPORTED(); }
/*      */   
/*      */   public abstract void ssoAuthAccount(Account paramAccount, AuthContext.Protocol paramProtocol, Map<String, Object> paramMap) throws ServiceException;
/*      */   
/*      */   public abstract void changePassword(Account paramAccount, String paramString1, String paramString2) throws ServiceException;
/*      */   
/*      */   public abstract SetPasswordResult setPassword(Account paramAccount, String paramString) throws ServiceException;
/*      */   
/*      */   public static abstract interface EagerAutoProvisionScheduler { public abstract boolean isShutDownRequested();
/*      */   }
/*      */   
/*      */   public static abstract interface DirectoryEntryVisitor { public abstract void visit(String paramString, Map<String, Object> paramMap); }
/*      */   
/*      */   public static class SetPasswordResult { public SetPasswordResult() {}
/*      */     
/* 1219 */     public SetPasswordResult(String msg) { setMessage(msg); }
/*      */     
/*      */     public boolean hasMessage()
/*      */     {
/* 1223 */       return this.msg != null;
/*      */     }
/*      */     
/*      */     public void setMessage(String msg) {
/* 1227 */       this.msg = msg;
/*      */     }
/*      */     
/*      */     public String getMessage() {
/* 1231 */       return this.msg;
/*      */     }
/*      */     
/*      */     String msg;
/*      */   }
/*      */   
/*      */   public SetPasswordResult setPassword(Account acct, String newPassword, boolean enforcePasswordPolicy) throws ServiceException
/*      */   {
/* 1239 */     throw ServiceException.UNSUPPORTED();
/*      */   }
/*      */   
/*      */ 
/*      */   public abstract void checkPasswordStrength(Account paramAccount, String paramString)
/*      */     throws ServiceException;
/*      */   
/*      */ 
/*      */   public abstract void addAlias(Account paramAccount, String paramString)
/*      */     throws ServiceException;
/*      */   
/*      */ 
/*      */   public abstract void removeAlias(Account paramAccount, String paramString)
/*      */     throws ServiceException;
/*      */   
/*      */ 
/*      */   public NamedEntry searchAliasTarget(Alias alias, boolean mustFind)
/*      */     throws ServiceException
/*      */   {
/* 1258 */     String targetId = alias.getAttr("zimbraAliasTargetId");
/*      */     
/* 1260 */     String query = "(zimbraId=" + targetId + ")";
/*      */     
/* 1262 */     SearchDirectoryOptions options = new SearchDirectoryOptions();
/* 1263 */     options.setTypes(new SearchDirectoryOptions.ObjectType[] { SearchDirectoryOptions.ObjectType.accounts, SearchDirectoryOptions.ObjectType.resources, SearchDirectoryOptions.ObjectType.distributionlists, SearchDirectoryOptions.ObjectType.dynamicgroups });
/*      */     
/*      */ 
/*      */ 
/* 1267 */     options.setFilterString(ZLdapFilterFactory.FilterId.SEARCH_ALIAS_TARGET, query);
/*      */     
/* 1269 */     List<NamedEntry> entries = searchDirectory(options);
/*      */     
/* 1271 */     if ((mustFind) && (entries.size() == 0)) {
/* 1272 */       throw ServiceException.FAILURE("target " + targetId + " of alias " + alias.getName() + " not found " + query, null);
/*      */     }
/* 1274 */     if (entries.size() > 1) {
/* 1275 */       throw AccountServiceException.TOO_MANY_SEARCH_RESULTS("too many results for search " + query, null);
/*      */     }
/* 1277 */     if (entries.size() == 0) {
/* 1278 */       return null;
/*      */     }
/* 1280 */     return (NamedEntry)entries.get(0);
/*      */   }
/*      */   
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */   public NamedEntry getAliasTarget(Alias alias, boolean mustFind)
/*      */     throws ServiceException
/*      */   {
/* 1292 */     return searchAliasTarget(alias, mustFind);
/*      */   }
/*      */   
/*      */ 
/*      */ 
/*      */ 
/*      */   public static ServerSelector getSelector(Server server)
/*      */   {
/* 1300 */     if (server == null)
/* 1301 */       return null;
/* 1302 */     return ServerSelector.fromId(server.getId());
/*      */   }
/*      */   
/*      */ 
/*      */ 
/*      */ 
/*      */   public static DomainSelector getSelector(Domain domain)
/*      */   {
/* 1310 */     if (domain == null)
/* 1311 */       return null;
/* 1312 */     return DomainSelector.fromId(domain.getId());
/*      */   }
/*      */   
/*      */ 
/*      */ 
/*      */ 
/*      */   public static UCServiceSelector getSelector(UCService ucService)
/*      */   {
/* 1320 */     if (ucService == null)
/* 1321 */       return null;
/* 1322 */     return UCServiceSelector.fromId(ucService.getId());
/*      */   }
/*      */   
/*      */ 
/*      */ 
/*      */ 
/*      */   public static AccountSelector getSelector(Account acct)
/*      */   {
/* 1330 */     if (acct == null)
/* 1331 */       return null;
/* 1332 */     return AccountSelector.fromId(acct.getId());
/*      */   }
/*      */   
/*      */ 
/*      */ 
/*      */ 
/*      */   public static DistributionListSelector getSelector(DistributionList dl)
/*      */   {
/* 1340 */     if (dl == null)
/* 1341 */       return null;
/* 1342 */     return DistributionListSelector.fromId(dl.getId());
/*      */   }
/*      */   
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */   public abstract Domain createDomain(String paramString, Map<String, Object> paramMap)
/*      */     throws ServiceException;
/*      */   
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */   public abstract Domain get(Key.DomainBy paramDomainBy, String paramString)
/*      */     throws ServiceException;
/*      */   
/*      */ 
/*      */ 
/*      */ 
/*      */   public Domain get(DomainSelector domSel)
/*      */     throws ServiceException
/*      */   {
/* 1365 */     return get(domSel.getBy().toKeyDomainBy(), domSel.getKey());
/*      */   }
/*      */   
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */   public Domain getDomain(Key.DomainBy keyType, String key, boolean checkNegativeCache)
/*      */     throws ServiceException
/*      */   {
/* 1379 */     return get(keyType, key);
/*      */   }
/*      */   
/* 1382 */   public Domain getDomainByName(String name) throws ServiceException { return get(Key.DomainBy.name, name); }
/* 1383 */   public Domain getDomainById(String id) throws ServiceException { return get(Key.DomainBy.id, id); }
/* 1384 */   public Domain getDomainByVirtualHostname(String host) throws ServiceException { return get(Key.DomainBy.virtualHostname, host); }
/* 1385 */   public Domain getDomainByKrb5Realm(String realm) throws ServiceException { return get(Key.DomainBy.krb5Realm, realm); }
/* 1386 */   public Domain getDomainByForeignName(String realm) throws ServiceException { return get(Key.DomainBy.foreignName, realm); }
/*      */   
/*      */   public abstract List<Domain> getAllDomains() throws ServiceException;
/*      */   
/*      */   public void getAllDomains(NamedEntry.Visitor visitor, String[] retAttrs) throws ServiceException
/*      */   {
/* 1392 */     throw ServiceException.UNSUPPORTED();
/*      */   }
/*      */   
/*      */   public abstract void deleteDomain(String paramString) throws ServiceException;
/*      */   
/*      */   public abstract Cos createCos(String paramString, Map<String, Object> paramMap) throws ServiceException;
/*      */   
/*      */   public abstract Cos copyCos(String paramString1, String paramString2) throws ServiceException;
/*      */   
/*      */   public abstract void renameCos(String paramString1, String paramString2) throws ServiceException;
/*      */   
/*      */   public abstract Cos get(Key.CosBy paramCosBy, String paramString) throws ServiceException;
/*      */   
/* 1405 */   public Cos getCosByName(String name) throws ServiceException { return get(Key.CosBy.name, name); }
/* 1406 */   public Cos getCosById(String id) throws ServiceException { return get(Key.CosBy.id, id); }
/*      */   
/*      */   public abstract List<Cos> getAllCos() throws ServiceException;
/*      */   
/*      */   public abstract void deleteCos(String paramString) throws ServiceException;
/*      */   
/*      */   public abstract Server getLocalServer() throws ServiceException;
/*      */   
/*      */   public static final class Reasons {
/* 1415 */     StringBuilder sb = new StringBuilder();
/*      */     
/* 1417 */     public void addReason(String reason) { if (0 < this.sb.length()) {
/* 1418 */         this.sb.append('\n');
/*      */       }
/* 1420 */       this.sb.append(reason);
/*      */     }
/*      */     
/* 1423 */     public String getReason() { return this.sb.toString(); }
/*      */   }
/*      */   
/*      */   public static boolean onLocalServer(Account account) throws ServiceException
/*      */   {
/* 1428 */     return onLocalServer(account, null);
/*      */   }
/*      */   
/*      */   public static boolean onLocalServer(Account account, Reasons reasons) throws ServiceException {
/* 1432 */     String target = account.getAttr("zimbraMailHost");
/* 1433 */     String localhost = getInstance().getLocalServer().getAttr("zimbraServiceHostname");
/* 1434 */     boolean isLocal = (target != null) && (target.equalsIgnoreCase(localhost));
/* 1435 */     boolean onLocalSvr = (isLocal) || (isAlwaysOn(account));
/* 1436 */     if ((!onLocalSvr) && (reasons != null)) {
/* 1437 */       reasons.addReason(String.format("onLocalSvr=%b isLocal=%b target=%s localhost=%s account=%s", new Object[] { Boolean.valueOf(onLocalSvr), Boolean.valueOf(isLocal), target, localhost, account.getName() }));
/*      */     }
/*      */     
/* 1440 */     return onLocalSvr;
/*      */   }
/*      */   
/*      */   private static boolean isAlwaysOn(Account account) throws ServiceException {
/* 1444 */     return isAlwaysOn(account, null);
/*      */   }
/*      */   
/*      */   private static boolean isAlwaysOn(Account account, Reasons reasons) throws ServiceException {
/* 1448 */     String localServerClusterId = Zimbra.getAlwaysOnClusterId();
/* 1449 */     Server server = getInstance().getServer(account);
/* 1450 */     String accountHostingServerClusterId = null;
/* 1451 */     if (server != null) {
/* 1452 */       accountHostingServerClusterId = server.getAlwaysOnClusterId();
/*      */     }
/* 1454 */     boolean isAlwaysOn = (server != null) && (localServerClusterId != null) && (accountHostingServerClusterId != null) && (localServerClusterId.equals(accountHostingServerClusterId));
/*      */     
/* 1456 */     if ((!isAlwaysOn) && (reasons != null)) {
/* 1457 */       reasons.addReason(String.format("isAlwaysOn=%b server=%s localServerClusterId=%s account=%s", new Object[] { Boolean.valueOf(isAlwaysOn), server, localServerClusterId, account.getName() }));
/*      */     }
/*      */     
/* 1460 */     return isAlwaysOn;
/*      */   }
/*      */   
/*      */   public static boolean onLocalServer(Group group) throws ServiceException {
/* 1464 */     String target = group.getAttr("zimbraMailHost");
/* 1465 */     String localhost = getInstance().getLocalServer().getAttr("zimbraServiceHostname");
/* 1466 */     return (target != null) && (target.equalsIgnoreCase(localhost));
/*      */   }
/*      */   
/*      */   public abstract Server createServer(String paramString, Map<String, Object> paramMap) throws ServiceException;
/*      */   
/*      */   public abstract Server get(Key.ServerBy paramServerBy, String paramString) throws ServiceException;
/*      */   
/* 1473 */   public Server getServerByName(String name) throws ServiceException { return get(Key.ServerBy.name, name); }
/* 1474 */   public Server getServerById(String id) throws ServiceException { return get(Key.ServerBy.id, id); }
/* 1475 */   public Server getServerByServiceHostname(String name) throws ServiceException { return get(Key.ServerBy.serviceHostname, name); }
/*      */   
/*      */   public abstract List<Server> getAllServers() throws ServiceException;
/*      */   
/*      */   public abstract List<Server> getAllServers(String paramString) throws ServiceException;
/*      */   
/*      */   public abstract List<Server> getAllServers(String paramString1, String paramString2) throws ServiceException;
/*      */   
/*      */   public List<Server> getAllWebClientServers() throws ServiceException {
/* 1484 */     List<Server> mailboxservers = getAllServers("mailbox");
/* 1485 */     List<Server> webclientservers = getAllServers("zimbra");
/*      */     
/* 1487 */     for (Server server : mailboxservers) {
/* 1488 */       String version = server.getAttr("zimbraServerVersion", null);
/*      */       
/* 1490 */       if (version == null)
/*      */       {
/*      */ 
/*      */ 
/* 1494 */         webclientservers.add(server);
/*      */       }
/*      */     }
/* 1497 */     return webclientservers;
/*      */   }
/*      */   
/*      */   public List<Server> getAllAdminClientServers() throws ServiceException {
/* 1501 */     List<Server> mailboxservers = getAllServers("mailbox");
/* 1502 */     List<Server> adminclientservers = getAllServers("zimbraAdmin");
/*      */     
/* 1504 */     for (Server server : mailboxservers) {
/* 1505 */       String version = server.getAttr("zimbraServerVersion", null);
/*      */       
/* 1507 */       if (version == null)
/*      */       {
/*      */ 
/*      */ 
/* 1511 */         adminclientservers.add(server);
/*      */       }
/*      */     }
/* 1514 */     return adminclientservers;
/*      */   }
/*      */   
/*      */   public List<Server> getAllZimletServers() throws ServiceException {
/* 1518 */     List<Server> mailboxservers = getAllServers("mailbox");
/* 1519 */     List<Server> zimletservers = getAllServers("zimlet");
/*      */     
/* 1521 */     for (Server server : mailboxservers) {
/* 1522 */       String version = server.getAttr("zimbraServerVersion", null);
/*      */       
/* 1524 */       if (version == null)
/*      */       {
/*      */ 
/*      */ 
/* 1528 */         zimletservers.add(server);
/*      */       }
/*      */     }
/* 1531 */     return zimletservers;
/*      */   }
/*      */   
/*      */   public List<Server> getAllDeployableZimletServers() throws ServiceException
/*      */   {
/* 1536 */     List<Server> deployableservers = new ArrayList();
/*      */     
/* 1538 */     for (Server server : getAllZimletServers()) {
/* 1539 */       if ((server.isLocalServer()) || (server.hasMailClientService())) {
/* 1540 */         deployableservers.add(server);
/*      */       }
/*      */     }
/*      */     
/* 1544 */     return deployableservers;
/*      */   }
/*      */   
/*      */   public List<Server> getAllMailClientServers() throws ServiceException {
/* 1548 */     List<Server> mailboxservers = getAllServers("mailbox");
/* 1549 */     List<Server> mailclientservers = getAllServers("service");
/*      */     
/* 1551 */     for (Server server : mailboxservers) {
/* 1552 */       String version = server.getAttr("zimbraServerVersion", null);
/*      */       
/* 1554 */       if (version == null)
/*      */       {
/*      */ 
/*      */ 
/* 1558 */         mailclientservers.add(server);
/*      */       }
/*      */     }
/* 1561 */     return mailclientservers;
/*      */   }
/*      */   
/*      */   public abstract void deleteServer(String paramString) throws ServiceException;
/*      */   
/*      */   public abstract AlwaysOnCluster createAlwaysOnCluster(String paramString, Map<String, Object> paramMap) throws ServiceException;
/*      */   
/*      */   public abstract AlwaysOnCluster get(Key.AlwaysOnClusterBy paramAlwaysOnClusterBy, String paramString) throws ServiceException;
/*      */   
/*      */   public abstract void deleteAlwaysOnCluster(String paramString) throws ServiceException;
/*      */   
/*      */   public abstract List<AlwaysOnCluster> getAllAlwaysOnClusters() throws ServiceException;
/*      */   
/*      */   public abstract UCService createUCService(String paramString, Map<String, Object> paramMap) throws ServiceException;
/*      */   
/*      */   public abstract void deleteUCService(String paramString) throws ServiceException;
/*      */   
/*      */   public abstract UCService get(Key.UCServiceBy paramUCServiceBy, String paramString) throws ServiceException;
/*      */   
/*      */   public abstract List<UCService> getAllUCServices() throws ServiceException;
/*      */   
/*      */   public abstract void renameUCService(String paramString1, String paramString2) throws ServiceException;
/*      */   
/*      */   public String updatePresenceSessionId(String zimbraId, String username, String password) throws ServiceException {
/* 1585 */     throw ServiceException.UNSUPPORTED();
/*      */   }
/*      */   
/*      */   public abstract DistributionList createDistributionList(String paramString, Map<String, Object> paramMap)
/*      */     throws ServiceException;
/*      */   
/*      */   public abstract DistributionList get(Key.DistributionListBy paramDistributionListBy, String paramString)
/*      */     throws ServiceException;
/*      */   
/*      */   public abstract void deleteDistributionList(String paramString)
/*      */     throws ServiceException;
/*      */   
/*      */   public abstract void addMembers(DistributionList paramDistributionList, String[] paramArrayOfString)
/*      */     throws ServiceException;
/*      */   
/*      */   public abstract void removeMembers(DistributionList paramDistributionList, String[] paramArrayOfString)
/*      */     throws ServiceException;
/*      */   
/*      */   public abstract void addAlias(DistributionList paramDistributionList, String paramString)
/*      */     throws ServiceException;
/*      */   
/*      */   public abstract void removeAlias(DistributionList paramDistributionList, String paramString)
/*      */     throws ServiceException;
/*      */   
/*      */   public abstract void renameDistributionList(String paramString1, String paramString2)
/*      */     throws ServiceException;
/*      */   
/*      */   public boolean isDistributionList(String addr)
/*      */   {
/* 1614 */     return false;
/*      */   }
/*      */   
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */   public DistributionList getDLBasic(Key.DistributionListBy keyType, String key)
/*      */     throws ServiceException
/*      */   {
/* 1630 */     return get(keyType, key);
/*      */   }
/*      */   
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */   public DynamicGroup createDynamicGroup(String listAddress, Map<String, Object> listAttrs)
/*      */     throws ServiceException
/*      */   {
/* 1643 */     throw ServiceException.UNSUPPORTED();
/*      */   }
/*      */   
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */   public Group createGroup(String listAddress, Map<String, Object> listAttrs, boolean dynamic)
/*      */     throws ServiceException
/*      */   {
/* 1666 */     throw ServiceException.UNSUPPORTED();
/*      */   }
/*      */   
/*      */   public Group createDelegatedGroup(String listAddress, Map<String, Object> listAttrs, boolean dynamic, Account creator)
/*      */     throws ServiceException
/*      */   {
/* 1672 */     throw ServiceException.UNSUPPORTED();
/*      */   }
/*      */   
/*      */   public void deleteGroup(String zimbraId) throws ServiceException {
/* 1676 */     throw ServiceException.UNSUPPORTED();
/*      */   }
/*      */   
/*      */   public void renameGroup(String zimbraId, String newName) throws ServiceException {
/* 1680 */     throw ServiceException.UNSUPPORTED();
/*      */   }
/*      */   
/*      */   public Group getGroup(Key.DistributionListBy keyType, String key) throws ServiceException {
/* 1684 */     throw ServiceException.UNSUPPORTED();
/*      */   }
/*      */   
/*      */   public Group getGroup(Key.DistributionListBy keyType, String key, boolean loadFromMaster) throws ServiceException
/*      */   {
/* 1689 */     throw ServiceException.UNSUPPORTED();
/*      */   }
/*      */   
/*      */ 
/*      */ 
/*      */   public Group getGroupBasic(Key.DistributionListBy keyType, String key)
/*      */     throws ServiceException
/*      */   {
/* 1697 */     throw ServiceException.UNSUPPORTED();
/*      */   }
/*      */   
/*      */ 
/*      */   public List getAllGroups(Domain domain)
/*      */     throws ServiceException
/*      */   {
/* 1704 */     throw ServiceException.UNSUPPORTED();
/*      */   }
/*      */   
/*      */   public void addGroupMembers(Group group, String[] members) throws ServiceException {
/* 1708 */     throw ServiceException.UNSUPPORTED();
/*      */   }
/*      */   
/*      */   public void removeGroupMembers(Group group, String[] members) throws ServiceException {
/* 1712 */     throw ServiceException.UNSUPPORTED();
/*      */   }
/*      */   
/*      */   public void addGroupAlias(Group group, String alias) throws ServiceException {
/* 1716 */     throw ServiceException.UNSUPPORTED();
/*      */   }
/*      */   
/*      */   public void removeGroupAlias(Group group, String alias) throws ServiceException {
/* 1720 */     throw ServiceException.UNSUPPORTED();
/*      */   }
/*      */   
/*      */   public String[] getGroupMembers(Group group) throws ServiceException {
/* 1724 */     return group.getAllMembers();
/*      */   }
/*      */   
/*      */ 
/*      */ 
/*      */ 
/*      */   public Set<String> getGroups(Account acct)
/*      */     throws ServiceException
/*      */   {
/* 1733 */     throw ServiceException.UNSUPPORTED();
/*      */   }
/*      */   
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */   public List<Group> getGroups(Account acct, boolean directOnly, Map<String, String> via)
/*      */     throws ServiceException
/*      */   {
/* 1746 */     throw ServiceException.UNSUPPORTED();
/*      */   }
/*      */   
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */   public boolean inACLGroup(Account acct, String zimbraId)
/*      */     throws ServiceException
/*      */   {
/* 1758 */     throw ServiceException.UNSUPPORTED();
/*      */   }
/*      */   
/*      */ 
/*      */ 
/*      */ 
/*      */   public abstract Zimlet getZimlet(String paramString)
/*      */     throws ServiceException;
/*      */   
/*      */ 
/*      */ 
/*      */ 
/*      */   public abstract List<Zimlet> listAllZimlets()
/*      */     throws ServiceException;
/*      */   
/*      */ 
/*      */ 
/*      */ 
/*      */   public abstract Zimlet createZimlet(String paramString, Map<String, Object> paramMap)
/*      */     throws ServiceException;
/*      */   
/*      */ 
/*      */ 
/*      */ 
/*      */   public abstract void deleteZimlet(String paramString)
/*      */     throws ServiceException;
/*      */   
/*      */ 
/*      */ 
/*      */ 
/*      */   public abstract CalendarResource createCalendarResource(String paramString1, String paramString2, Map<String, Object> paramMap)
/*      */     throws ServiceException;
/*      */   
/*      */ 
/*      */ 
/*      */ 
/*      */   public abstract void deleteCalendarResource(String paramString)
/*      */     throws ServiceException;
/*      */   
/*      */ 
/*      */ 
/*      */   public abstract void renameCalendarResource(String paramString1, String paramString2)
/*      */     throws ServiceException;
/*      */   
/*      */ 
/*      */ 
/*      */   public abstract CalendarResource get(Key.CalendarResourceBy paramCalendarResourceBy, String paramString)
/*      */     throws ServiceException;
/*      */   
/*      */ 
/*      */ 
/*      */   public CalendarResource getCalendarResourceByName(String name)
/*      */     throws ServiceException
/*      */   {
/* 1812 */     return get(Key.CalendarResourceBy.name, name);
/*      */   }
/*      */   
/*      */   public CalendarResource getCalendarResourceById(String id) throws ServiceException {
/* 1816 */     return get(Key.CalendarResourceBy.id, id);
/*      */   }
/*      */   
/*      */   public CalendarResource get(Key.CalendarResourceBy keyType, String key, boolean loadFromMaster) throws ServiceException {
/* 1820 */     return get(keyType, key);
/*      */   }
/*      */   
/*      */   private static Locale getEntryLocale(Entry entry, String attr) {
/* 1824 */     Locale lc = null;
/* 1825 */     if (entry != null) {
/* 1826 */       String lcName = entry.getAttr(attr);
/* 1827 */       if (lcName != null)
/* 1828 */         lc = L10nUtil.lookupLocale(lcName);
/*      */     }
/* 1830 */     return lc;
/*      */   }
/*      */   
/*      */   private static Locale getEntryLocale(Entry entry) {
/* 1834 */     return getEntryLocale(entry, "zimbraLocale");
/*      */   }
/*      */   
/*      */   public Locale getLocale(Entry entry) throws ServiceException {
/* 1838 */     if ((entry instanceof Account))
/*      */     {
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/* 1850 */       Account account = (Account)entry;
/* 1851 */       Locale lc = getEntryLocale(account, "zimbraPrefLocale");
/* 1852 */       if (lc != null) return lc;
/* 1853 */       Cos cos = getCOS(account);
/* 1854 */       lc = getEntryLocale(cos, "zimbraPrefLocale");
/* 1855 */       if (lc != null) return lc;
/* 1856 */       lc = getEntryLocale(account);
/* 1857 */       if (lc != null) return lc;
/* 1858 */       lc = getEntryLocale(cos);
/* 1859 */       if (lc != null) return lc;
/* 1860 */       lc = getEntryLocale(getDomain(account));
/* 1861 */       if (lc != null) return lc;
/* 1862 */       return getLocale(getServer(account)); }
/* 1863 */     if ((entry instanceof Server))
/*      */     {
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/* 1869 */       Locale lc = getEntryLocale(entry);
/* 1870 */       if (lc != null) return lc;
/* 1871 */       return getLocale(getInstance().getConfig()); }
/* 1872 */     if ((entry instanceof Config))
/*      */     {
/*      */ 
/*      */ 
/*      */ 
/* 1877 */       Locale lc = getEntryLocale(entry);
/* 1878 */       if (lc != null) return lc;
/* 1879 */       return Locale.getDefault();
/*      */     }
/*      */     
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/* 1890 */     Locale lc = getEntryLocale(entry);
/* 1891 */     if (lc != null) return lc;
/* 1892 */     return getLocale(getInstance().getLocalServer());
/*      */   }
/*      */   
/*      */ 
/*      */   public abstract List getAllAccounts(Domain paramDomain)
/*      */     throws ServiceException;
/*      */   
/*      */ 
/*      */   public abstract void getAllAccounts(Domain paramDomain, NamedEntry.Visitor paramVisitor)
/*      */     throws ServiceException;
/*      */   
/*      */ 
/*      */   public abstract void getAllAccounts(Domain paramDomain, Server paramServer, NamedEntry.Visitor paramVisitor)
/*      */     throws ServiceException;
/*      */   
/*      */   public abstract List getAllCalendarResources(Domain paramDomain)
/*      */     throws ServiceException;
/*      */   
/*      */   public abstract void getAllCalendarResources(Domain paramDomain, NamedEntry.Visitor paramVisitor)
/*      */     throws ServiceException;
/*      */   
/*      */   public abstract void getAllCalendarResources(Domain paramDomain, Server paramServer, NamedEntry.Visitor paramVisitor)
/*      */     throws ServiceException;
/*      */   
/*      */   public abstract List getAllDistributionLists(Domain paramDomain)
/*      */     throws ServiceException;
/*      */   
/*      */   public void searchAccountsOnServer(Server server, SearchAccountsOptions opts, NamedEntry.Visitor visitor)
/*      */     throws ServiceException
/*      */   {
/* 1922 */     throw ServiceException.UNSUPPORTED();
/*      */   }
/*      */   
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */   public List<NamedEntry> searchAccountsOnServer(Server server, SearchAccountsOptions opts)
/*      */     throws ServiceException
/*      */   {
/* 1935 */     throw ServiceException.UNSUPPORTED();
/*      */   }
/*      */   
/*      */   public List<NamedEntry> searchDirectory(SearchDirectoryOptions options) throws ServiceException {
/* 1939 */     throw ServiceException.UNSUPPORTED();
/*      */   }
/*      */   
/*      */   public void searchDirectory(SearchDirectoryOptions options, NamedEntry.Visitor visitor) throws ServiceException
/*      */   {
/* 1944 */     throw ServiceException.UNSUPPORTED();
/*      */   }
/*      */   
/*      */   public static enum GalMode {
/* 1948 */     zimbra, 
/* 1949 */     ldap, 
/* 1950 */     both;
/*      */     
/*      */     private GalMode() {}
/*      */     
/* 1954 */     public static GalMode fromString(String s) throws ServiceException { try { if (s == null)
/* 1955 */           return null;
/* 1956 */         return valueOf(s);
/*      */       } catch (IllegalArgumentException e) {
/* 1958 */         throw ServiceException.INVALID_REQUEST("unknown gal mode: " + s, e);
/*      */       }
/*      */     }
/*      */   }
/*      */   
/*      */ 
/*      */ 
/*      */   public static class SearchGalResult
/*      */   {
/*      */     private String mToken;
/*      */     
/*      */ 
/*      */     private boolean mHadMore;
/*      */     
/*      */ 
/*      */     private final List<GalContact> mMatches;
/*      */     
/*      */     private String mTokenizeKey;
/*      */     
/*      */ 
/*      */     public static SearchGalResult newSearchGalResult(GalContact.Visitor visitor)
/*      */     {
/* 1980 */       if (visitor == null) {
/* 1981 */         return new SearchGalResult();
/*      */       }
/* 1983 */       return new Provisioning.VisitorSearchGalResult(visitor, null);
/*      */     }
/*      */     
/*      */     private SearchGalResult() {
/* 1987 */       this.mMatches = new ArrayList();
/*      */     }
/*      */     
/*      */     public String getToken() {
/* 1991 */       return this.mToken;
/*      */     }
/*      */     
/*      */     public void setToken(String token) {
/* 1995 */       this.mToken = token;
/*      */     }
/*      */     
/*      */     public boolean getHadMore() {
/* 1999 */       return this.mHadMore;
/*      */     }
/*      */     
/*      */     public void setHadMore(boolean hadMore) {
/* 2003 */       this.mHadMore = hadMore;
/*      */     }
/*      */     
/*      */     public String getTokenizeKey() {
/* 2007 */       return this.mTokenizeKey;
/*      */     }
/*      */     
/*      */     public void setTokenizeKey(String tokenizeKey) {
/* 2011 */       this.mTokenizeKey = tokenizeKey;
/*      */     }
/*      */     
/*      */     public List<GalContact> getMatches() throws ServiceException {
/* 2015 */       return this.mMatches;
/*      */     }
/*      */     
/*      */     public int getNumMatches() {
/* 2019 */       return this.mMatches.size();
/*      */     }
/*      */     
/*      */     public void addMatch(GalContact gc) throws ServiceException {
/* 2023 */       this.mMatches.add(gc);
/*      */     }
/*      */     
/*      */ 
/* 2027 */     public void addMatches(SearchGalResult result) throws ServiceException { this.mMatches.addAll(result.getMatches()); }
/*      */   }
/*      */   
/*      */   public static class VisitorSearchGalResult extends Provisioning.SearchGalResult {
/*      */     private final GalContact.Visitor mVisitor;
/*      */     private int mNumMatches;
/*      */     
/*      */     private VisitorSearchGalResult(GalContact.Visitor visitor) {
/* 2035 */       super();
/* 2036 */       this.mVisitor = visitor;
/*      */     }
/*      */     
/*      */     public List<GalContact> getMatches() throws ServiceException
/*      */     {
/* 2041 */       throw ServiceException.FAILURE("getMatches not supported for VisitorSearchGalResult", null);
/*      */     }
/*      */     
/*      */     public int getNumMatches()
/*      */     {
/* 2046 */       return this.mNumMatches;
/*      */     }
/*      */     
/*      */     public void addMatch(GalContact gc) throws ServiceException
/*      */     {
/* 2051 */       this.mVisitor.visit(gc);
/* 2052 */       this.mNumMatches += 1;
/*      */     }
/*      */     
/*      */     public void addMatches(Provisioning.SearchGalResult result) throws ServiceException
/*      */     {
/* 2057 */       if (!(result instanceof VisitorSearchGalResult)) {
/* 2058 */         throw ServiceException.FAILURE("cannot addMatches with non VisitorSearchGalResult", null);
/*      */       }
/* 2060 */       this.mNumMatches += result.getNumMatches();
/*      */     }
/*      */   }
/*      */   
/*      */ 
/*      */   public SearchGalResult autoCompleteGal(Domain domain, String query, GalSearchType type, int limit, GalContact.Visitor visitor)
/*      */     throws ServiceException
/*      */   {
/* 2068 */     throw ServiceException.UNSUPPORTED();
/*      */   }
/*      */   
/*      */   public SearchGalResult searchGal(Domain domain, String query, GalSearchType type, int limit, GalContact.Visitor visitor)
/*      */     throws ServiceException
/*      */   {
/* 2074 */     throw ServiceException.UNSUPPORTED();
/*      */   }
/*      */   
/*      */   public SearchGalResult syncGal(Domain domain, String token, GalContact.Visitor visitor) throws ServiceException
/*      */   {
/* 2079 */     throw ServiceException.UNSUPPORTED();
/*      */   }
/*      */   
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */   public SearchGalResult searchGal(Domain d, String query, GalSearchType type, GalMode mode, String token)
/*      */     throws ServiceException
/*      */   {
/* 2097 */     throw ServiceException.UNSUPPORTED();
/*      */   }
/*      */   
/*      */   public void searchGal(GalSearchParams params) throws ServiceException {
/* 2101 */     throw ServiceException.UNSUPPORTED();
/*      */   }
/*      */   
/*      */   public Identity getDefaultIdentity(Account account) throws ServiceException {
/* 2105 */     Map<String, Object> attrs = new HashMap();
/* 2106 */     Set<String> identityAttrs = AttributeManager.getInstance().getAttrsInClass(AttributeClass.identity);
/*      */     
/* 2108 */     for (String name : identityAttrs) {
/* 2109 */       String value = account.getAttr(name, null);
/* 2110 */       if (value != null) attrs.put(name, value);
/*      */     }
/* 2112 */     if (attrs.get("zimbraPrefIdentityName") == null) {
/* 2113 */       attrs.put("zimbraPrefIdentityName", "DEFAULT");
/*      */     }
/* 2115 */     String fromAddress = (String)attrs.get("zimbraPrefFromAddress");
/* 2116 */     String fromDisplay = (String)attrs.get("zimbraPrefFromDisplay");
/*      */     
/* 2118 */     if ((fromAddress == null) || (fromDisplay == null)) {
/* 2119 */       InternetAddress ia = AccountUtil.getFriendlyEmailAddress(account);
/* 2120 */       if (fromAddress == null) attrs.put("zimbraPrefFromAddress", ia.getAddress());
/* 2121 */       if (fromDisplay == null) attrs.put("zimbraPrefFromDisplay", ia.getPersonal());
/*      */     }
/* 2123 */     attrs.put("zimbraPrefIdentityId", account.getId());
/*      */     
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/* 2132 */     if (attrs.get("zimbraPrefForwardReplyFormat") == null) {
/* 2133 */       boolean forwardReplyInOriginalFormat = account.getBooleanAttr("zimbraPrefForwardReplyInOriginalFormat", false);
/* 2134 */       if (forwardReplyInOriginalFormat) {
/* 2135 */         attrs.put("zimbraPrefForwardReplyFormat", "same");
/*      */       } else {
/* 2137 */         String composeFormat = account.getAttr("zimbraPrefComposeFormat", null);
/* 2138 */         if (composeFormat == null) {
/* 2139 */           attrs.put("zimbraPrefForwardReplyFormat", "text");
/*      */         } else
/* 2141 */           attrs.put("zimbraPrefForwardReplyFormat", composeFormat);
/*      */       }
/*      */     }
/* 2144 */     return new Identity(account, "DEFAULT", account.getId(), attrs, this);
/*      */   }
/*      */   
/*      */   public abstract Identity createIdentity(Account paramAccount, String paramString, Map<String, Object> paramMap)
/*      */     throws ServiceException;
/*      */   
/*      */   public abstract Identity restoreIdentity(Account paramAccount, String paramString, Map<String, Object> paramMap)
/*      */     throws ServiceException;
/*      */   
/*      */   public abstract void modifyIdentity(Account paramAccount, String paramString, Map<String, Object> paramMap)
/*      */     throws ServiceException;
/*      */   
/*      */   public abstract void deleteIdentity(Account paramAccount, String paramString)
/*      */     throws ServiceException;
/*      */   
/*      */   public abstract List<Identity> getAllIdentities(Account paramAccount)
/*      */     throws ServiceException;
/*      */   
/*      */   public abstract Identity get(Account paramAccount, Key.IdentityBy paramIdentityBy, String paramString)
/*      */     throws ServiceException;
/*      */   
/*      */   public abstract Signature createSignature(Account paramAccount, String paramString, Map<String, Object> paramMap)
/*      */     throws ServiceException;
/*      */   
/*      */   public abstract Signature restoreSignature(Account paramAccount, String paramString, Map<String, Object> paramMap)
/*      */     throws ServiceException;
/*      */   
/*      */   public abstract void modifySignature(Account paramAccount, String paramString, Map<String, Object> paramMap)
/*      */     throws ServiceException;
/*      */   
/*      */   public abstract void deleteSignature(Account paramAccount, String paramString) throws ServiceException;
/*      */   
/*      */   public abstract List<Signature> getAllSignatures(Account paramAccount) throws ServiceException;
/*      */   
/*      */   public abstract Signature get(Account paramAccount, Key.SignatureBy paramSignatureBy, String paramString) throws ServiceException;
/*      */   
/*      */   public abstract DataSource createDataSource(Account paramAccount, DataSourceType paramDataSourceType, String paramString, Map<String, Object> paramMap) throws ServiceException;
/*      */   
/*      */   public abstract DataSource createDataSource(Account paramAccount, DataSourceType paramDataSourceType, String paramString, Map<String, Object> paramMap, boolean paramBoolean) throws ServiceException;
/*      */   
/*      */   public abstract DataSource restoreDataSource(Account paramAccount, DataSourceType paramDataSourceType, String paramString, Map<String, Object> paramMap) throws ServiceException;
/*      */   
/*      */   public abstract void modifyDataSource(Account paramAccount, String paramString, Map<String, Object> paramMap) throws ServiceException;
/*      */   
/*      */   public abstract void deleteDataSource(Account paramAccount, String paramString) throws ServiceException;
/*      */   
/*      */   public abstract List<DataSource> getAllDataSources(Account paramAccount) throws ServiceException;
/*      */   
/*      */   public abstract DataSource get(Account paramAccount, Key.DataSourceBy paramDataSourceBy, String paramString) throws ServiceException;
/*      */   
/*      */   public abstract XMPPComponent createXMPPComponent(String paramString, Domain paramDomain, Server paramServer, Map<String, Object> paramMap) throws ServiceException;
/*      */   
/*      */   public abstract XMPPComponent get(Key.XMPPComponentBy paramXMPPComponentBy, String paramString) throws ServiceException;
/*      */   
/*      */   public abstract List<XMPPComponent> getAllXMPPComponents() throws ServiceException;
/*      */   
/*      */   public abstract void deleteXMPPComponent(XMPPComponent paramXMPPComponent) throws ServiceException;
/*      */   
/*      */   public static class RightsDoc
/*      */   {
/*      */     String mCmd;
/*      */     List<String> mRights;
/*      */     List<String> mNotes;
/*      */     
/*      */     public RightsDoc(String cmd)
/*      */     {
/* 2210 */       this.mCmd = cmd;
/* 2211 */       this.mRights = Lists.newArrayList();
/* 2212 */       this.mNotes = Lists.newArrayList();
/*      */     }
/*      */     
/*      */     public RightsDoc(CmdRightsInfo cmd) {
/* 2216 */       this(cmd.getName());
/* 2217 */       for (NamedElement right : cmd.getRights())
/* 2218 */         addRight(right.getName());
/* 2219 */       for (String note : cmd.getNotes())
/* 2220 */         addNote(note);
/*      */     }
/*      */     
/*      */     public void addRight(String right) {
/* 2224 */       this.mRights.add(right);
/*      */     }
/*      */     
/*      */     public void addNote(String note) {
/* 2228 */       this.mNotes.add(note);
/*      */     }
/*      */     
/*      */     public String getCmd() {
/* 2232 */       return this.mCmd;
/*      */     }
/*      */     
/*      */     public List<String> getRights() {
/* 2236 */       return this.mRights;
/*      */     }
/*      */     
/*      */     public List<String> getNotes() {
/* 2240 */       return this.mNotes;
/*      */     }
/*      */   }
/*      */   
/*      */   public Map<String, List<RightsDoc>> getRightsDoc(String[] pkgs) throws ServiceException {
/* 2245 */     throw ServiceException.UNSUPPORTED();
/*      */   }
/*      */   
/*      */   public Right getRight(String rightName, boolean expandAllAttrs) throws ServiceException {
/* 2249 */     throw ServiceException.UNSUPPORTED();
/*      */   }
/*      */   
/*      */   public List<Right> getAllRights(String targetType, boolean expandAllAttrs, String rightClass) throws ServiceException {
/* 2253 */     throw ServiceException.UNSUPPORTED();
/*      */   }
/*      */   
/*      */ 
/*      */ 
/*      */   public boolean checkRight(String targetType, TargetBy targetBy, String target, GranteeSelector.GranteeBy granteeBy, String grantee, String right, Map<String, Object> attrs, AccessManager.ViaGrant via)
/*      */     throws ServiceException
/*      */   {
/* 2261 */     throw ServiceException.UNSUPPORTED();
/*      */   }
/*      */   
/*      */   public RightCommand.AllEffectiveRights getAllEffectiveRights(String granteeType, GranteeSelector.GranteeBy granteeBy, String grantee, boolean expandSetAttrs, boolean expandGetAttrs)
/*      */     throws ServiceException
/*      */   {
/* 2267 */     throw ServiceException.UNSUPPORTED();
/*      */   }
/*      */   
/*      */ 
/*      */   public RightCommand.EffectiveRights getEffectiveRights(String targetType, TargetBy targetBy, String target, GranteeSelector.GranteeBy granteeBy, String grantee, boolean expandSetAttrs, boolean expandGetAttrs)
/*      */     throws ServiceException
/*      */   {
/* 2274 */     throw ServiceException.UNSUPPORTED();
/*      */   }
/*      */   
/*      */ 
/*      */ 
/*      */   public RightCommand.EffectiveRights getCreateObjectAttrs(String targetType, Key.DomainBy domainBy, String domainStr, Key.CosBy cosBy, String cosStr, GranteeSelector.GranteeBy granteeBy, String grantee)
/*      */     throws ServiceException
/*      */   {
/* 2282 */     throw ServiceException.UNSUPPORTED();
/*      */   }
/*      */   
/*      */ 
/*      */   public RightCommand.Grants getGrants(String targetType, TargetBy targetBy, String target, String granteeType, GranteeSelector.GranteeBy granteeBy, String grantee, boolean granteeIncludeGroupsGranteeBelongs)
/*      */     throws ServiceException
/*      */   {
/* 2289 */     throw ServiceException.UNSUPPORTED();
/*      */   }
/*      */   
/*      */ 
/*      */   public void grantRight(String targetType, TargetBy targetBy, String target, String granteeType, GranteeSelector.GranteeBy granteeBy, String grantee, String secret, String right, RightModifier rightModifier)
/*      */     throws ServiceException
/*      */   {
/* 2296 */     throw ServiceException.UNSUPPORTED();
/*      */   }
/*      */   
/*      */ 
/*      */   public void revokeRight(String targetType, TargetBy targetBy, String target, String granteeType, GranteeSelector.GranteeBy granteeBy, String grantee, String right, RightModifier rightModifier)
/*      */     throws ServiceException
/*      */   {
/* 2303 */     throw ServiceException.UNSUPPORTED();
/*      */   }
/*      */   
/* 2306 */   public ShareLocator getShareLocatorById(String id) throws ServiceException { return get(Key.ShareLocatorBy.id, id); }
/*      */   
/*      */   public abstract ShareLocator get(Key.ShareLocatorBy paramShareLocatorBy, String paramString) throws ServiceException;
/*      */   
/*      */   public abstract ShareLocator createShareLocator(String paramString, Map<String, Object> paramMap) throws ServiceException;
/*      */   
/*      */   public abstract void deleteShareLocator(String paramString) throws ServiceException;
/* 2313 */   public ShareLocator createShareLocator(String id, String ownerAccountId) throws ServiceException { Map<String, Object> attrs = new HashMap();
/* 2314 */     attrs.put("zimbraShareOwnerAccountId", ownerAccountId);
/* 2315 */     return createShareLocator(id, attrs); }
/*      */   
/*      */   public abstract void flushCache(CacheEntryType paramCacheEntryType, CacheEntry[] paramArrayOfCacheEntry) throws ServiceException;
/*      */   
/*      */   public static class CacheEntry { public Key.CacheEntryBy mEntryBy;
/*      */     
/* 2321 */     public CacheEntry(Key.CacheEntryBy entryBy, String entryIdentity) { this.mEntryBy = entryBy;
/* 2322 */       this.mEntryIdentity = entryIdentity;
/*      */     }
/*      */     
/*      */ 
/*      */     public String mEntryIdentity;
/*      */   }
/*      */   
/*      */ 
/*      */   public static class CountAccountResult
/*      */   {
/*      */     public static class CountAccountByCos
/*      */     {
/*      */       private final String mCosId;
/*      */       
/*      */       private final String mCosName;
/*      */       private final long mCount;
/*      */       
/*      */       CountAccountByCos(String cosId, String cosName, long count)
/*      */       {
/* 2341 */         this.mCosId = cosId;
/* 2342 */         this.mCosName = cosName;
/* 2343 */         this.mCount = count;
/*      */       }
/*      */       
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/* 2350 */       public String getCosId() { return this.mCosId; }
/* 2351 */       public String getCosName() { return this.mCosName; }
/* 2352 */       public long getCount() { return this.mCount; }
/*      */     }
/*      */     
/* 2355 */     private final List<CountAccountByCos> mCountAccountByCos = new ArrayList();
/*      */     
/*      */     public void addCountAccountByCosResult(String cosId, String cosName, long count) {
/* 2358 */       CountAccountByCos r = new CountAccountByCos(cosId, cosName, count);
/* 2359 */       this.mCountAccountByCos.add(r);
/*      */     }
/*      */     
/*      */     public List<CountAccountByCos> getCountAccountByCos() {
/* 2363 */       return this.mCountAccountByCos;
/*      */     }
/*      */   }
/*      */   
/*      */   public CountAccountResult countAccount(Domain domain) throws ServiceException
/*      */   {
/* 2369 */     throw ServiceException.UNSUPPORTED();
/*      */   }
/*      */   
/*      */   public long countObjects(CountObjectsType type, Domain domain, UCService ucService) throws ServiceException
/*      */   {
/* 2374 */     throw ServiceException.UNSUPPORTED();
/*      */   }
/*      */   
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */   public static void validEmailAddress(String addr)
/*      */     throws ServiceException
/*      */   {
/* 2384 */     NameUtil.validEmailAddress(addr);
/*      */   }
/*      */   
/*      */   public static boolean isUUID(String value)
/*      */   {
/* 2389 */     return StringUtil.isUUID(value);
/*      */   }
/*      */   
/*      */ 
/*      */ 
/*      */ 
/*      */   public String getProxyAuthToken(String targetAcctId, Map<String, Object> originalContext)
/*      */     throws ServiceException
/*      */   {
/* 2398 */     return null;
/*      */   }
/*      */   
/*      */   public boolean isOfflineProxyServer(Server server) {
/* 2402 */     return false;
/*      */   }
/*      */   
/*      */   public boolean allowsPingRemote() {
/* 2406 */     return true;
/*      */   }
/*      */   
/*      */ 
/*      */ 
/*      */   public void purgeAccountCalendarCache(String accountId)
/*      */     throws ServiceException
/*      */   {}
/*      */   
/*      */ 
/*      */ 
/*      */   public void reloadMemcachedClientConfig()
/*      */     throws ServiceException
/*      */   {}
/*      */   
/* 2422 */   public void getShareInfo(Account ownerAcct, PublishedShareInfoVisitor visitor)
/* 2422 */     throws ServiceException { throw ServiceException.UNSUPPORTED(); }
/*      */   
/*      */   public static abstract interface PublishedShareInfoVisitor { public abstract void visit(ShareInfoData paramShareInfoData) throws ServiceException;
/*      */   }
/*      */   
/* 2427 */   public static enum EntryType { account, 
/* 2428 */     group, 
/* 2429 */     config, 
/* 2430 */     cos, 
/* 2431 */     domain, 
/* 2432 */     server, 
/* 2433 */     zimlet;
/*      */     
/*      */     private EntryType() {} }
/*      */   
/* 2437 */   public Map<String, String> getNamesForIds(Set<String> ids, EntryType type) throws ServiceException { return new HashMap(); }
/*      */   
/*      */ 
/*      */   public static abstract interface ProvisioningValidator
/*      */   {
/*      */     public static final String CREATE_ACCOUNT_SUCCEEDED = "createAccountSucceeded";
/*      */     public static final String CREATE_ACCOUNT = "createAccount";
/*      */     public static final String CREATE_ACCOUNT_CHECK_DOMAIN_COS_AND_FEATURE = "createAccountCheckDomainCosAndFeature";
/*      */     public static final String MODIFY_ACCOUNT_CHECK_DOMAIN_COS_AND_FEATURE = "modifyAccountCheckDomainCosAndFeature";
/*      */     public static final String RENAME_ACCOUNT = "renameAccount";
/*      */     public static final String RENAME_ACCOUNT_CHECK_DOMAIN_COS_AND_FEATURE = "renameAccountCheckDomainCosAndFeature";
/*      */     public static final String DELETE_ACCOUNT_SUCCEEDED = "deleteAccountSucceeded";
/*      */     
/*      */     public abstract void validate(Provisioning paramProvisioning, String paramString, Object... paramVarArgs) throws ServiceException;
/*      */     
/*      */     public abstract void refresh();
/*      */   }
/*      */   
/*      */   public static class Result
/*      */   {
/*      */     String code;
/*      */     String message;
/*      */     String detail;
/*      */     
/* 2461 */     public String getCode() { return this.code; }
/* 2462 */     public String getMessage() { return this.message; }
/* 2463 */     public String getComputedDn() { return this.detail; }
/* 2464 */     public Object getDetail() { return this.detail; }
/*      */     
/*      */     public Result(String status, String message, String detail) {
/* 2467 */       this.code = status;
/* 2468 */       this.message = message;
/* 2469 */       this.detail = detail;
/*      */     }
/*      */     
/*      */     public Result(String status, Exception e, String detail) {
/* 2473 */       this.code = status;
/* 2474 */       this.message = ExceptionToString.ToString(e);
/* 2475 */       this.detail = detail;
/*      */     }
/*      */     
/*      */     public String toString()
/*      */     {
/* 2480 */       return "Result { code: " + this.code + " detail: " + this.detail + " message: " + this.message + " }";
/*      */     }
/*      */   }
/*      */   
/*      */ 
/*      */ 
/* 2486 */   public Result checkAuthConfig(Map<String, Object> attrs, String name, String password) throws ServiceException { throw ServiceException.UNSUPPORTED(); }
/*      */   
/*      */   public static class GalResult extends Provisioning.Result {
/*      */     private final List<GalContact> mResult;
/*      */     
/*      */     public GalResult(String status, String message, List<GalContact> result) {
/* 2492 */       super(message, null);
/* 2493 */       this.mResult = result;
/*      */     }
/*      */     
/*      */     public List<GalContact> getContacts() {
/* 2497 */       return this.mResult;
/*      */     }
/*      */   }
/*      */   
/*      */   public Result checkGalConfig(Map attrs, String query, int limit, GalOp galOp) throws ServiceException
/*      */   {
/* 2503 */     throw ServiceException.UNSUPPORTED();
/*      */   }
/*      */   
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */   public Map<String, Map<String, Object>> getDomainSMIMEConfig(Domain domain, String configName)
/*      */     throws ServiceException
/*      */   {
/* 2513 */     throw ServiceException.UNSUPPORTED();
/*      */   }
/*      */   
/*      */   public void modifyDomainSMIMEConfig(Domain domain, String configName, Map<String, Object> attrs) throws ServiceException {
/* 2517 */     throw ServiceException.UNSUPPORTED();
/*      */   }
/*      */   
/*      */   public void removeDomainSMIMEConfig(Domain domain, String configName) throws ServiceException {
/* 2521 */     throw ServiceException.UNSUPPORTED();
/*      */   }
/*      */   
/*      */   public Map<String, Map<String, Object>> getConfigSMIMEConfig(String configName) throws ServiceException
/*      */   {
/* 2526 */     throw ServiceException.UNSUPPORTED();
/*      */   }
/*      */   
/*      */   public void modifyConfigSMIMEConfig(String configName, Map<String, Object> attrs) throws ServiceException {
/* 2530 */     throw ServiceException.UNSUPPORTED();
/*      */   }
/*      */   
/*      */   public void removeConfigSMIMEConfig(String configName) throws ServiceException {
/* 2534 */     throw ServiceException.UNSUPPORTED();
/*      */   }
/*      */   
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */   public void register(ProvisioningValidator validator)
/*      */   {
/* 2544 */     synchronized (this.validators) {
/* 2545 */       this.validators.add(validator);
/*      */     }
/*      */   }
/*      */   
/*      */   protected void validate(String action, Object... args) throws ServiceException {
/* 2550 */     for (ProvisioningValidator validator : this.validators) {
/* 2551 */       validator.validate(this, action, args);
/*      */     }
/*      */   }
/*      */   
/*      */   public void refreshValidators() {
/* 2556 */     for (ProvisioningValidator validator : this.validators) {
/* 2557 */       validator.refresh();
/*      */     }
/*      */   }
/*      */ }


/* Location:              /home/mint/zimbrastore.jar!/com/zimbra/cs/account/Provisioning.class
 * Java compiler version: 7 (51.0)
 * JD-Core Version:       0.7.1
 */